<template>
  <div class="srbd">
    <div class="bd">
      <div class="cesaun_container">
        <h3 class="title">
          <p class="line">手机号测吉凶</p>
        </h3>
        <div>
          <div>
            <el-form
              :model="form"
              ref="form"
              label-width="120px"
              label-position="right"
            >
              <!-- 姓名 -->
              <el-form-item label="请输入手机号：" prop="name">
                <el-input
                  v-model="form.shouji"
                  type="number"
                  placeholder="请输入一个数字"
                  clearable
                  style="width: 450px"
                ></el-input>
              </el-form-item>
            </el-form>
          </div>
        </div>
        <div style="text-align: center">
          <el-button type="primary" @click="submitForm" style="margin: 20px"
            >立即测算</el-button
          >
        </div>

        <!-- 主体表单 -->
      </div>
      <div>
        <h3 class="title">
          <p class="line">测算简介</p>
        </h3>
        <div style="font-size: 14px; margin: 0 10px 20px 10px">
          <p style="">
            1.数字吉凶，乃是与华人智慧息息相关，有河洛图，河洛之数所蕴含的奥妙。通过吉凶之五行，五行与命格之关系，可判断数字吉凶，数字排列也与号码选择有关。数字吉凶的选择，渗透生活的方方面面，QQ号码，手机号，车牌号，选好的数字排列或吉利的数字，对生活多会起到好的作用。
          </p>
          <p>
            2.运用易学智慧，融合西方幸运数字生命灵数，在数字选择上更具有专业，先进的数字科技，进行吉凶占卜。帮助大家分析所用到的号码，对生活的影响，性格命运的转变，以及事业，爱情全方位的定位。可适用于手机号码的选择，电话号码的选择及门牌号码，车牌号，幸运数字的选择。
          </p>
          <p>3.心诚则灵，测算结果仅供参考。</p>
        </div>
      </div>
    </div>
    <el-dialog
      title="测算结果"
      :visible.sync="centerDialogVisible"
      width="50%"
      class="dialog_cesuan"
    >
      <div class="bazi_info" v-if="result != null">
        <div class="base_info">
          <div class="show">
            <span class="l">您输入的数 :</span>
            <span class="r">{{ result.data }}</span>
          </div>
          <div class="show">
            <span class="l">吉凶:</span>
            <span class="r">{{ result.xiongji }}</span>
          </div>

          <div class="show">
            <span class="l">数理:</span>
            <span class="r">{{ result.shuli }}</span>
          </div>

          <div class="show">
            <span class="l">签语:</span>
            <span class="r">{{ result.desc }}</span>
          </div>
        </div>

        <div class="yl">
          <span>仅供娱乐！请勿当真</span>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  computed: {
    currentPath() {
      return this.$route.path; // 获取当前路由路径
    },
  },
  data() {
    return {
      centerDialogVisible: false,
      birthday: "",

      result: {
        desc: "云开见月，虽有劳碌，光明坦途，指日可期。", //签语
        xiongji: "吉", //吉凶
        desc1: "",
        score: "96", //打分
        data: 999, //您输入的数999
        shuli: 39, //数理 第39 数
      },
      area: "",
      form: {
        shouji: "",
      },
    };
  },
  mounted() {},
  methods: {
    submitForm() {
      if (this.form.shouji == "") {
        this.$message({
          message: "请输入手机号！",
          type: "warning",
        });
        return;
      }

      this.form["api_key"] = "FNcQHQuf0W8wDrXMjWc0xqTzw";
      let config = {
        headers: {
          "Content-Type": "application/x-www-form-urlencoded",
        },
      };
      this.$axios
        .post(window.config.apiUrl + "/v1/Jixiong/shouji", this.form, config)
        .then((res) => {
          if (res.data.errcode == -1) {
            this.$message({
              type: "warning",
              message: res.data.errmsg,
            });

            return;
          }

          this.centerDialogVisible = true;
          this.result = res.data.data;
          console.log(this.result);
        });
    },
  },
};
</script>

<style scoped lang="scss">
.bd {
  border: 1px solid #e5e5e5;
}

.cesaun_container {
}

::v-deep .el-card.is-always-shadow {
  box-shadow: none !important;
}

::v-deep .el-card__header {
  padding: 10px 20px !important;
}

.form-card {
  width: 100%;
  margin: 0 auto;
  border-radius: 2px;
}

.form-title {
  margin: 0;
  color: #303133;
  font-size: 16px;
  text-align: left;
}

.el-form-item {
  margin-bottom: 22px;
}

.el-radio {
  margin-right: 30px;
}

::v-deep .distpicker-address-wrapper {
  width: 100% !important;
}

@mixin flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  height: 45px;
}

@mixin tr1_w {
  width: 33px;
  text-align: center;
}

.dialog_cesuan {
  text {
    user-select: all;
  }

  .bazi_info {
    .base_info {
      margin: 20px;

      .title {
        display: flex;
        padding: 5px;

        .shu {
          width: 5px;
          height: 20px;
          background-color: #e6a84b;
          border-radius: 10px;
        }

        .ti {
          padding-left: 8px;
          font-weight: 800;
          font-size: 15px;
        }
      }

      .show {
        margin-top: 15px;

        .l_ {
          font-size: 14px;
          display: inline-block;
          min-width: 50px;
          font-weight: 800;
        }

        .l {
          font-size: 15px;
          display: inline-block;
          min-width: 80px;
          font-weight: 800;
        }
      }

      .details {
        border: 1px solid #e5e5e5;
        border-bottom: none;
        margin-top: 20px;

        .names {
          text-align: center;
          color: #e6a84b;
          border-bottom: 1px solid #e5e5e5;
          color: #e6a84b;
          font-weight: 800;
          background-color: #fff3ef;
          height: 50px;
          line-height: 50px;
        }

        .des {
          border-bottom: 1px solid #e5e5e5;
          padding-left: 10px;
          display: flex;
          align-items: center;

          .des_text {
            color: #e6a84b;
            width: 14%;
            font-weight: 800;
            user-select: text;
          }

          .des_deta {
            width: 85%;
            line-height: 26px;
            text-indent: 2em;
            user-select: text;
          }
        }
      }
    }
  }
}
</style>